<template>
  <div class="mail">
    <EmailList  v-cloak name="emailListTab"></EmailList>
  </div>
</template>
<script>
    import EmailList from '@/components/mail/list/EmailList'
    import {mapState} from 'vuex'
    import {getToken} from '@/util/auth'
    export default {
        name: 'mail',
        components: {EmailList},
        computed: {
            ...mapState(['common'])
        },
        created(){
            if(getToken()){
                if (this.common.emailList.length == 0) {
                    this.$confirm(' <div style="margin: 20px 10px;">\n' +
                        '        <p style="line-height: 30px;\n' +
                        '        font-size: 14px;">您需要先绑定自己的常用邮箱到我们的平台，才可以使用邮件模块功能哦！</p>\n' +
                        '        <p style="line-height: 30px;\n' +
                        '        font-size: 14px;">点击下方的按钮即可立即去绑定。</p>\n' +
                        '      </div>', '邮箱绑定提醒', {
                        dangerouslyUseHTMLString: true,
                        confirmButtonText: '去绑定',
                        cancelButtonText: '取 消'
                    }).then(()=>{
                        this.$store.commit('SET_CURRENTSETFRAG', 'eight')
                        this.$router.push('/mail/administration');
                    }).catch(()=>{})
                }
            }
        }
    }
</script>

<style lang="scss" scoped>
</style>


